/**
 * Copyright (c) 2024 Huawei Technologies Co., Ltd.
 * This file is a part of the CANN Open Software.
 * Licensed under CANN Open Software License Agreement Version 1.0 (the "License").
 * Please refer to the License for details. You may not use this file except in compliance with the License.
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
 * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
 * See LICENSE in the root of the software repository for the full text of the License.
 */

/*!
* \file matmul_private.h
* \brief
*/
#ifndef IMPL_MATMUL_MODULES_MATMUL_PRIVATE_MODULES_H_
#define IMPL_MATMUL_MODULES_MATMUL_PRIVATE_MODULES_H_

#include "resource/cube_in_buffer/cube_in_buffer_params.h"
#include "stage/copy_cube_in/batch/batch_copy_cube_in_intf.h"
#include "stage/copy_cube_in/copy_cube_in_params.h"
#include "stage/copy_cube_in/data_copy_wrapper.h"
#include "stage/copy_cube_in/batch/batch_layout.h"
#include "stage/copy_cube_in/batch/batch_data_copy_wrapper.h"
#include "param/matmul_var.h"
#include "param/matmul_shape_info.h"
#include "stage/quant/quant_processor.h"
#include "param/matmul_tensor_info.h"
#include "param/matmul_subblock_info.h"
#include "param/matmul_shape_tiling.h"
#include "param/matmul_antiquant_processor.h"
#include "iterator/matmul_iterate_controller.h"

namespace matmul {

template <const auto& MM_CFG, typename IMPL, typename A_TYPE, typename B_TYPE, typename C_TYPE, typename BIAS_TYPE>
struct MatmulPrivateModules {
    using CubeInBufferParamsA = CubeInBufferParams<IMPL, MM_CFG, MatmulInputAType<A_TYPE, typename A_TYPE::T>>;
    using CubeInBufferParamsB = CubeInBufferParams<IMPL, MM_CFG, MatmulInputBType<B_TYPE, typename A_TYPE::T>>;
    using CopyCubeInParamsA = CopyCubeInParams<IMPL, MM_CFG, MatmulInputAType<A_TYPE, typename A_TYPE::T>>;
    using CopyCubeInParamsB = CopyCubeInParams<IMPL, MM_CFG, MatmulInputBType<B_TYPE, typename A_TYPE::T>>;
    using MatmulVarA = MatmulVar<IMPL, MM_CFG, MatmulInputAType<A_TYPE, typename A_TYPE::T>>;
    using MatmulVarB = MatmulVar<IMPL, MM_CFG, MatmulInputBType<B_TYPE, typename A_TYPE::T>>;
    using MatmulVarC = MatmulVar<IMPL, MM_CFG, MatmulInputCType<C_TYPE, typename C_TYPE::T>>;
    using MatmulTensorInfoA = MatmulTensorInfo<IMPL, MM_CFG, MatmulInputAType<A_TYPE, typename A_TYPE::T>>;
    using MatmulTensorInfoB = MatmulTensorInfo<IMPL, MM_CFG, MatmulInputBType<B_TYPE, typename A_TYPE::T>>;
    using MatmulSubBlockInfo = matmul::MatmulSubBlockInfo<IMPL, MM_CFG>;
    using MatmulShapeTilingA = MatmulShapeTiling<IMPL, MM_CFG, MatmulInputAType<A_TYPE, typename A_TYPE::T>>;
    using MatmulShapeTilingB = MatmulShapeTiling<IMPL, MM_CFG, MatmulInputBType<B_TYPE, typename A_TYPE::T>>;
    using MatmulShapeTilingC = MatmulShapeTiling<IMPL, MM_CFG, MatmulInputCType<C_TYPE, typename C_TYPE::T>>;
    using MatmulAntiQuantProcessor = matmul::MatmulAntiQuantProcessor<IMPL, MM_CFG, MatmulInputBType<B_TYPE, typename A_TYPE::T>>;
    using DataCopyUtilsA = DataCopyWrapper<IMPL, MM_CFG, MatmulInputAType<A_TYPE, typename A_TYPE::T>>;
    using DataCopyUtilsB = DataCopyWrapper<IMPL, MM_CFG, MatmulInputBType<B_TYPE, typename A_TYPE::T>>;
    using BatchDataCopyUtilsA = BatchDataCopyWrapper<IMPL, MM_CFG, MatmulInputAType<A_TYPE, typename A_TYPE::T>>;
    using BatchDataCopyUtilsB = BatchDataCopyWrapper<IMPL, MM_CFG, MatmulInputBType<B_TYPE, typename A_TYPE::T>>;
    using BatchLayoutA = BatchLayout<IMPL, MatmulInputAType<A_TYPE, typename A_TYPE::T>>;
    using BatchLayoutB = BatchLayout<IMPL, MatmulInputBType<B_TYPE, typename A_TYPE::T>>;
    using DataWarp = matmul::DataWarp<IMPL, MM_CFG, C_TYPE::layout>;
    using QuantProcessor = matmul::QuantProcessor<IMPL, A_TYPE, C_TYPE, MM_CFG,
        matmul::MatmulFeatureTrait<MM_CFG>::GetCubeOutType()>;
    using BatchCopyCubeInA = BatchCopyCubeIn<IMPL, MatmulInputAType<A_TYPE, typename A_TYPE::T>, MM_CFG>;
    using BatchCopyCubeInB = BatchCopyCubeIn<IMPL, MatmulInputBType<B_TYPE, typename A_TYPE::T>, MM_CFG>;
    using IterateController =
        matmul::MatmulIterateController<IMPL, A_TYPE, B_TYPE, matmul::MatmulFeatureTrait<MM_CFG>::iterCtrlCfg>;
    using MatmulShapeInfoA = MatmulShapeInfo<IMPL, MM_CFG, MatmulInputAType<A_TYPE, typename A_TYPE::T>>;
    using MatmulShapeInfoB = MatmulShapeInfo<IMPL, MM_CFG, MatmulInputBType<B_TYPE, typename A_TYPE::T>>;
    using MatmulShapeInfoC = MatmulShapeInfo<IMPL, MM_CFG, MatmulInputCType<C_TYPE, typename C_TYPE::T>>;
};
}
#endif // _MATMUL_PRIVATE_MODULES_H_
